'use strict';
const db = uniCloud.database()
const uniID = require('uni-id')
exports.main = async (event, context) => {
	//event为客户端上传的参数
	const user= await uniID.checkToken(event.uniIdToken)
	console.log("checkToken:",user)
	
	let res = await db.collection('uni-id-users')
	.where({
		_id:user.uid
	})
	.get()
	console.log('event : ', event)
	
	//返回数据给客户端
	return res
};
